package com.eric.rabbit.entity.topic;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;

/**
 * @author:Eric
 * @date:2021/6/28
 */
@Slf4j
@Data
public class TopicReceiver {

    @RabbitListener(queues = "#{topicQueue1.name}")
    public void receive1(String in) {
        log.info(" [receive1] Received '{}'", in);
    }

    @RabbitListener(queues = "#{topicQueue2.name}")
    public void receive2(String in) {
        log.info(" [receive2] Received '{}'", in);
    }

    @RabbitListener(queues = "queue-1")
    public void sameKeyReceive1(String in){
        log.info(" [sameKeyReceive1] Received '{}'", in);
    }
    @RabbitListener(queues = "queue-2")
    public void sameKeyReceive2(String in){
        log.info(" [sameKeyReceive2] Received '{}'", in);
    }
}
